@extends('layouts.default')
@section('content')
@include('modules.thanhmenu')
<?php 
if(HomeController::checkInTime('dssvdk')){
    
    
    $msn=$thong_tin[0]->ms_nhom;
    $tdt=$thong_tin[0]->ten_de_tai;
?>
<table width="750" cellspacing="0" cellpadding="0" border="0">
    <tr>
        <td class="tl_main"></td>
        <td class="tc_main" colspan="5"></td>
        <td class="tr_main"></td>        
    </tr>
     <tr>
        <td class="cl_main"></td>
        <td colspan="5">
            <table width="100%" cellspacing="0" cellpadding="0" border="0">
                    <tr>
                        <td align="center" colspan="5" class="title-danhsachhp blt btop brt bbot" style="color:red; font-size: 14px; font-weigh: bold">
                            Đề Tài : <?= $tdt ?>
                        </td>                                
                    </tr>
                     <tr>
                        <td align="center">
                            <form action="" method="GET" name="frmnk" >
                                    Tuần:
                                    <select class="exampleDiv" name="Tuan" id="TuanId">
                                        <?php
                                        $CanBoDGVaDBL = new CanBoDGVaDBL();
                                        $tuan =$CanBoDGVaDBL->getTuan($id_ke_hoach);
                                        foreach($tuan as $tuans)
                                        {
                                        ?> 
                                        <option name="Tuan" value="<?=$tuans->tuan?>" <?php if(Input::get('Tuan') == $tuans->tuan) echo "selected='selected'" ?>>
                                            <?=$tuans->tuan?>
                                        </option>
                                        <?php
                                        }
                                        ?>
                                    </select>
                                    <input type="submit" name="button" value="Liệt Kê" title="Xem Danh Sách Đề Tài" class="cm_footer exampleDiv" style="color:#fff"/> 
                            </form>
                        </td>
                    </tr>
            </table>
        </td>
        <td class="cr_main"></td>
    </tr>
    <tr>
        <td class="cl_main"></td>
        <td colspan="5">
            <table width="100%" cellpadding='0' cellspacing='0' border='0'class="btop brt">
                <tr>
                    <td align="center" class="cm_footer btop brt" style="color:#fff; font-size: 14px; font-weight: bold">
                        STT
                    </td>
                    <td align="center" class="cm_footer btop brt" style="color:#fff; font-size: 14px; font-weight: bold">
                        Nhóm
                    </td>
                    <td align="center" class="cm_footer btop brt" style="color:#fff; font-size: 14px; font-weight: bold">
                        Công Việc
                    </td>
                    <td align="center" class="cm_footer btop brt" style="color:#fff; font-size: 14px; font-weight: bold">
                        Đánh Giá
                    </td>
                     <td align="center" class="cm_footer btop brt" style="color:#fff; font-size: 14px; font-weight: bold">
                        Tuần
                    </td>
                    <td align="center" class="cm_footer btop brt" style="color:#fff; font-size: 14px; font-weight: bold">
                        Đánh Giá
                    </td>
                </tr>
                   <?php       
                    if(isset($_GET['Tuan'] ) ){
                       if(isset($msn)){
                            $tuan=$_GET['Tuan'];
                            $CanBoDGVaDBL = new CanBoDGVaDBL();
                            //$thongtin=$CanBoDGVaDBL->getThongTindt($msn);
                            $cong_viec=$CanBoDGVaDBL->getMoTaCongViec($iddt,$tuan);
                            $stt=0;                
                    foreach ($cong_viec as $key) {
                    ?>
                <form action='<?=URL?>cb_tuandanhgia'method='GET' name='frmgdg' id='frmgdgID' >
                <tr>
                    <td class="blt btop bbot"align='center'><?=++$stt?></td>
                    <td class="blt btop bbot"align='center'><?=$msn?></td>                                     
                    <td class="blt btop bbot"align='center'><?= $key->mo_ta_cong_viec?></td>
                    <td class="blt btop bbot"align='center'><?= $key->mo_ta_muc_do?></td>
                    <td class="blt btop bbot"align='center'><?= $tuan ?></td>
                    <td class="blt btop brt bbot"align='center'>
                        <input type='hidden' name='txtmsn' value='<?=$msn?>'/>
                        <input type='hidden' name='txttuan' value='<?=$tuan?>'/>
                        <select class="exampleDiv" name="danhgia" id="danhgiaID" method='GET'>
                            <option>--Mức Độ--</option>
                            <?php
                                $CanBo = new CanBoDGVaDBL();
                                $danhgia=$CanBo->getDanhGia();
                                foreach ($danhgia as $key) {
                            ?>
                            <option name="danhgia" value="<?= $key->id ?>" <?php if(Input::get('danhgia') == $key->mo_ta_muc_do) echo "selected='selected'" ?>>
                                <?=$key->mo_ta_muc_do?>
                            </option>
                            <?php
                            }
                            ?>
                        </select>
                    <img onclick="document.frmgdg.submit()" title="Save" class="exampleDiv"src="<?=URL?>public/images/duyet1.png"/>
                    </td>
                </tr>
                </form>
                <?php 
                } 
                        if (Session::has('trangthai')) {
                            if (Session::has('trangthai') == 1)
                                echo "<script>alert('Cập Nhật Đánh Giá Thành Công')</script>";
                            else {
                                echo "<script>alert('Cập Nhật Đánh Giá Thất Bại')</script>";
                            }
                        }
                }}?>
            </table>
        </td>
        <td class="cr_main"></td>
    </tr>
    <tr>
        <td class="bl_main"></td>
        <td class="bc_main" colspan="5"></td>
        <td class="br_main"></td>
    </tr>
</table>
<script type='text/javascript'>
function fcDanhGia(iddg,ms_nhom){
        location.href='<?=URL?>_tuandanhgia'+iddg+'/'+ms_nhom;
    }
</script>
<?php
}
else{
    echo "<script>alert('Chưa tới thời gian ghi đánh giá cho sinh viên!');'</script>";
}
?>
@stop